/**
 * Created by smp on 2017/5/17.
 */
var modelPath=ROOT_PATH+'/archives/personArchives/securityMeetingLedger/';
var MEETING_TYPE=CONSTANT.DictionaryTypeDefConstants.MEETING_TYPE;
$('#meetingType').combobox({
    url:ROOT_PATH+'/permission/dictionary/queryDictionaryByDictionaryTypeCode.shtml?code='+MEETING_TYPE,
    editable:false,
    valueField:'id',
    textField:'text'
});
$("#btn_save").click(function(){
    var index=layer.confirm('是否确定保存？', {
        btn: ['确定','取消'] //按钮
    }, function(){

        $('#form1').form('submit', {
            url: modelPath+'edit.shtml',

            onSubmit: function (param) {

                var isValid = $(this).form('validate');
                if (!isValid) {
                    layer.close(index);
                    layer.msg("请正确填写表单")
                }
                return $(this).form('validate');
            },
            success: function (result) {
                result = $.parseJSON(result);
                if (result.success){
                    layer.msg(result.message,{time:1000,icon:1},function () {
                        WindowManager.closeLayer({
                            returnValue: result
                        });
                    });
                }else {
                    //$.messager.progress('close');	// 如果提交成功则隐藏进度条
                    parent.layer.msg(result.message,{time:1000,icon:2});
                }
            }
        });
    });

});